<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<!-- 1 1 2 3 5 8 13 21-->

<body>

</body>

<script>
    var arr = [1, 3, 8, 5, 47, 4878, 874, 545, 7487, 4565, 45,]
    function paixu(arr) {
        for (let i = 0; i < arr.length - 1; i++) {
            for (let j = 0; j < arr.length - 1 - i; j++) {
                if (arr[j] > arr[j + 1]) {
                    var temp;
                    temp = arr[j];
                    arr[j] = arr[j + 1];
                    arr[j + 1] = temp;
                }

            }
        }
        return arr;

    }
    console.log(paixu(arr));



</script>

</html>